package com.ynu.znkz.controller;


import com.ynu.znkz.commomutils.R;
import com.ynu.znkz.service.PaperResearchObjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lu
 * @since 2021-05-29
 */
@RestController
@RequestMapping("/znkz/paperResearchObj")
public class PaperResearchObjController {
    @Autowired
    PaperResearchObjService paperResearchObjService;

    //增加研究对象
    @PostMapping("/addPaperResearchObj")
    public R savaPaperResearchObj(String paperResearchObjName,String parent_id){
        String result = paperResearchObjService.savePaperResearchObj(paperResearchObjName,parent_id);

        return R.ok().message("研究对象加入数据库成功").data("paperResearchObjId",result);
    }
}

